using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_StockMap : EntityTypeConfiguration<t_Stock>
    {
        public t_StockMap()
        {
            // Primary Key
            this.HasKey(t => t.FItemID);

            // Properties
            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBrNO)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FHelperCode)
                .HasMaxLength(30);

            this.Property(t => t.FAddress)
                .HasMaxLength(255);

            this.Property(t => t.FPhone)
                .HasMaxLength(30);

            this.Property(t => t.FName)
                .HasMaxLength(80);

            this.Property(t => t.FNumber)
                .HasMaxLength(80);

            this.Property(t => t.FShortNumber)
                .HasMaxLength(30);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.F_102)
                .HasMaxLength(10);

            this.Property(t => t.F_103)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("t_Stock");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FBrNO).HasColumnName("FBrNO");
            this.Property(t => t.FHelperCode).HasColumnName("FHelperCode");
            this.Property(t => t.FEmpID).HasColumnName("FEmpID");
            this.Property(t => t.FAddress).HasColumnName("FAddress");
            this.Property(t => t.FPhone).HasColumnName("FPhone");
            this.Property(t => t.FProperty).HasColumnName("FProperty");
            this.Property(t => t.FBWorkShop).HasColumnName("FBWorkShop");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FShortNumber).HasColumnName("FShortNumber");
            this.Property(t => t.FTypeID).HasColumnName("FTypeID");
            this.Property(t => t.FIsStockMgr).HasColumnName("FIsStockMgr");
            this.Property(t => t.FSPGroupID).HasColumnName("FSPGroupID");
            this.Property(t => t.FMRPAvail).HasColumnName("FMRPAvail");
            this.Property(t => t.FGroupID).HasColumnName("FGroupID");
            this.Property(t => t.FStockGroupID).HasColumnName("FStockGroupID");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FCalcCostOrder).HasColumnName("FCalcCostOrder");
            this.Property(t => t.FPlanArea).HasColumnName("FPlanArea");
            this.Property(t => t.F_102).HasColumnName("F_102");
            this.Property(t => t.F_103).HasColumnName("F_103");
        }
    }
}
